#include "user_app.h"

char DHT11_Init_OK[] = "DS12(110,37,'OK',15,0);\r\n"; 
char DS18B20_Init_OK[] = "DS12(110,67,'OK',15,0);\r\n";
char DS18B20_Init_ERROR[] = "DS12(110,67,'ERROR',15,0);\r\n";
char LED_Init_OK[] = "DS12(110,97,'OK',15,0);\r\n";
char BEEP_Init_OK[] = "DS12(110,127,'OK',15,0);\r\n";
extern char Warning_UI[];

void BIOS_Check(void)
{ 

    DHT11_Config();
    LCD_Show(DHT11_Init_OK);
    Delay_ms(300);
    
    if(DS18B20_Init())
        LCD_Show(DS18B20_Init_ERROR);
    else 
        LCD_Show(DS18B20_Init_OK);
    Delay_ms(300);
    
    LED_Config();
    LED_RUN(1);
    Delay_ms(800);
    LED_RUN(0);
    Delay_ms(800);
    LCD_Show(LED_Init_OK);
    
    Beep_Config();
    BEEP_ON;
    Delay_ms(800);
    BEEP_OFF;
    Delay_ms(800);
    LCD_Show(BEEP_Init_OK);
    
}

void  Warning_Beep(s16 value)
{ 
       if(value>=350)
       { 
           Warning_UI[20] = 'y';
           Warning_UI[21] = 'e';
           Warning_UI[22] = 's';
           LCD_Show(Warning_UI);
           BEEP_ON;
           Delay_ms(100);
           BEEP_OFF;
           Delay_ms(100);
       }
       else 
       { 
           Warning_UI[20] = 'n';
           Warning_UI[21] = 'o';
           Warning_UI[22] = ' ';
           LCD_Show(Warning_UI); 
           Delay_ms(100);           
       }
}
